package com.yej.aiPolice.ui.activity.web

import android.os.Bundle
import android.webkit.WebSettings
import android.webkit.WebView
import androidx.appcompat.app.AppCompatActivity
import com.yej.aiPolice.R
import com.yej.aiPolice.util.AiPoliceAPP
import com.yej.aiPolice.util.MyWebViewClient
import org.jetbrains.anko.find

class IMActivity:AppCompatActivity() {

    private var mWebView: WebView? = null
    private var webSettings: WebSettings? = null
    private var webUrl:String = ""
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.fragment_report)
        mWebView = find(R.id.wv_report_web)
        webUrl = AiPoliceAPP.HOSTURL + "/"
        init()
    }


    private fun init() {
        webSettings = mWebView?.settings
        webSettings!!.textZoom = 110
        webSettings!!.javaScriptEnabled = true
        webSettings!!.useWideViewPort =   true
        webSettings!!.setLoadWithOverviewMode(true)
        mWebView!!.setWebViewClient(MyWebViewClient())
        mWebView!!.loadUrl(webUrl)
    }
}